//
//  Soldier.m
//  Legions
//
//  Created by Anders Petersen on 13/05/14.
//  Copyright (c) 2014 Anders Petersen. All rights reserved.
//

#import "Soldier.h"

@implementation Soldier

- (instancetype)init
{
    self = [Soldier spriteNodeWithImageNamed:@"arrow"];
    if (self) {
        [self initObject];
    }
    return self;
}


-(void)initObject{
        [self setSize:CGSizeMake(SOLDIER_SIZE, SOLDIER_SIZE)];
        self.physicsBody      = [SKPhysicsBody  bodyWithCircleOfRadius:SOLDIER_SIZE/2];
        self.color = [SKColor whiteColor];
        self.colorBlendFactor = 1;
        self.alpha = 1;
        self.zPosition = 100;
    
    self.zRotation = -M_PI/2.0f;

        self.arrow = [[ArmySymbol alloc] init];
//        [self addChild:self.arrow];
}

- (void) turnRad    :(CGFloat)  rad with: (CGFloat) duration{
        [self.arrow removeAllActions];
        [self.arrow runAction:[SKAction rotateByAngle:rad duration:duration]];
    
}

@end
